home *** CD-ROM | disk | FTP | other *** search
- // ===============================================================
- // Vertex Program:
- // Description:
- // Last Update: 14/08/2003
- // Coder: Andrey Honich
- // ===============================================================
-
- #include "../CGVPMacro.csi"
-
-
- VertAttributes { POSITION_3 TEXCOORD0_2 TANG_3X3 }
- MainInput { VIEWPROJ_MATRIX, LIGHT_POS }
- DeclarationsScript
- {
- IN_T0_C0_TANG
- OUT_T0_T1
- }
- PositionScript = PosCommon
- CoreScript
- {
- OUT.Tex0.xy = IN.TexCoord0.xy;
-
- TANG_MATR
-
- // compute the 3x3 tranform from tangent space to object space
- // store normalized light vector
- float3 lightVec = LightPos.xyz - vPos.xyz;
-
- // transform light vector from object space to tangent space and pass it as a color
- OUT.Tex1.xyz = mul(objToTangentSpace, lightVec.xyz);
- }
-